// src/utils/avatar.js
// import Men from "@/static/avatar/TodayMen.jpg";
// import ModernMen from "@/static/avatar/ModernMen.jpg";
// import Women from "@/static/avatar/TodayWomen.jpg";
// import AncientWoMen from "@/static/avatar/AncientWoMen.jpg";
// import ModernWoMen from "@/static/avatar/ModernWoMen.jpg";
// import unknown from "@/static/avatar/unknown.png";
/**
 * 获取默认头像
 * @param {Object} options
 * @param {number|string} options.gender 性别（1男，2女）
 * @param {string|number} options.birthDate 出生日期（可选）
 * @returns {string} 头像URL
 */
export function getDefaultAvatar({ gender = 2, birthDate } = {}) {
  let age = 0;
  let birth;
  if (birthDate) {
    birth = new Date(birthDate);
  } else {
    birth = new Date(); // 如果birthDate为空，默认当前时间
  }
  const now = new Date();
  age = now.getFullYear() - birth.getFullYear();

  // 根据环境选择使用本地导入的图片或静态URL
  if (gender == 1) {
    if (age < 100) return "https://boyangli.oss-cn-shanghai.aliyuncs.com/20250930/60f908e9e52c4a9b8368abdf1255364b.jpg";
    if (age > 1000) return "https://boyangli.oss-cn-shanghai.aliyuncs.com/20250930/d560fd508cce44b5af0f7cc0e140b9e6.jpg";
  } else if (gender == 2) {
    if (age < 100) return "https://boyangli.oss-cn-shanghai.aliyuncs.com/20250930/b647ba9a62b5481d8a86dc2a9bba0854.jpg";
    if (age > 1000) return "https://boyangli.oss-cn-shanghai.aliyuncs.com/20250930/82f19393214d4997912062292033413a.jpg";
    return "https://boyangli.oss-cn-shanghai.aliyuncs.com/20250930/5b8acf1de14b4fbe83c1dc8fd098694b.jpg";
  }
  return "https://boyangli.oss-cn-shanghai.aliyuncs.com/20250930/0a47e21352c74dcd98afa325ea51d8dc.png";
}
